import React from 'react'
import { render } from 'react-dom'
import { HashRouter as Router, Route, Switch, Redirect } from 'react-router-dom'
import { LocaleProvider } from 'antd'
import zhCN from 'antd/es/locale-provider/zh_CN'
import App from './App'
import { mainRoutes } from './routes'

render(
    <LocaleProvider locale={zhCN}>
    <Router>
        <Switch>
            <Route path="/admin" render={
                () =>{
                    return <App/>
                    // const isLogin = true;
                    // if(isLogin){
                    //     return <App/>
                    // }else{
                    //     return <Redirect to ="/login" />
                    // }
                 
                }
            }/>
    {
        mainRoutes.map(item =>{
            return <Route key={item.path} path={item.path} component={item.component} />
        })
    }
    <Redirect from="/" to="admin" exact />
    <Redirect to="/404" />
    </Switch>
    </Router>
    </LocaleProvider>,
    document.querySelector('#root')
)                         






































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         